/**************************************************************************************
 *
 * @(#) ResponseHolder.java
 * @Package com.jgdt.jgdtkasannong_university_gene_backend.utils
 **************************************************************************************/
package com.jgdt.jgdtkasannong_university_gene_backend.utils;

import com.alibaba.ttl.TransmittableThreadLocal;
import jakarta.servlet.http.HttpServletResponse;

/**
 * @description: 定义可传递的 ThreadLocal 容器
 * @author: huangAn
 * @createDate: 2025/04/28
 */
public class ResponseHolder {

    private static final TransmittableThreadLocal<HttpServletResponse> RESPONSE_HOLDER =new TransmittableThreadLocal<>();

    public static void set(HttpServletResponse response) {
        RESPONSE_HOLDER.set(response);
    }

    public static HttpServletResponse get() {
        return RESPONSE_HOLDER.get();
    }

    public static void remove() {
        RESPONSE_HOLDER.remove();
    }
}




